Skip to content

Comments

Implement POSTs#36

Draft
relzp wants to merge 3 commits intomainfrom
hallett/post
Draft

Implement POSTs#36
relzp wants to merge 3 commits intomainfrom
hallett/post

Conversation

@relzp
Copy link
Contributor

@relzp relzp commented Jan 9, 2026

This PR aims to implement POSTs for NUSenseIO and any subsystems we can implement a POST for (currently just the IMU).
Currently:

  • Adds a post function to NUSenseIO which will call post functions for subsystems
  • Adds a post function to IMU which checks the WHOAMI register against a hardcoded device ID.
  • Runs and checks the return value of NUSenseIO's post function in main

relzp added 3 commits January 9, 2026 16:43
post() checks the value of the WHOAMI register against the constant IMU
device ID
post() will run the post functions of subsystems to ensure they exist
and can be communicated with
currently just calls the IMU post function
@relzp relzp requested a review from Claegtun January 9, 2026 06:14
@relzp relzp self-assigned this Jan 9, 2026
Comment on lines +111 to +115
if (who_am_i != IMU_DEVICE_ID) {
return false;
}

return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (who_am_i != IMU_DEVICE_ID) {
return false;
}
return true;
return who_am_i == IMU_DEVICE_ID

Comment on lines +91 to +94
bool posted_successfully = nusenseIO.post();
if (!posted_successfully) {
return -1;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool posted_successfully = nusenseIO.post();
if (!posted_successfully) {
return -1;
}
bool posted_successfully = nusenseIO.post();
if (!posted_successfully) {
// Insert a better tracker
}

You wouldnt want to just return -1 here in main, itd be useful to have an actual error message. Try using the buzzer or something else

@relzp relzp marked this pull request as draft February 20, 2026 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants